<%@ page pageEncoding="utf-8"%> 
<%@page import="java.sql.*"%>
<%@page import="java.util.*"%>

<%
	request.setAttribute("layout","main.jsp");
	request.setAttribute("page_title","温岭选课系统-课程申报审核");
	int i = 0;
  	List<Hashtable<String, String>> waitcheck_list = (List<Hashtable<String, String>>) session.getAttribute("WaitcheckList");
	Iterator<Hashtable<String, String>> waitcheck_it = waitcheck_list.iterator();
  	List<Hashtable<String, String>> checked_list = (List<Hashtable<String, String>>) session.getAttribute("CheckedList");
	Iterator<Hashtable<String, String>> checked_it = checked_list.iterator();
 %>
	<link href="css/jquery.ui.tabs.css" rel="stylesheet">
	<link href="css/jquery.ui.theme.css" rel="stylesheet">
	<script src="js/jquery-1.5.2.min.js"></script>
	<script src="js/jquery-ui-1.8.11.custom.min.js"></script>
	<script src="js/jquery.ui.tabs.js"></script>
	<script type="text/javascript" src="js/popup.js"></script>
	
	<script>
	$(function() {
		$( "#tabs" ).tabs();
		$(".approve").click(function(){
			ShowIframe('审批课程申请',base_path+"admin/courseApplyApproveDetail.jspx",700,600);
		});
	});
	
	function check(courseId){
	   $.ajax({
			url: base_path+"Admin/adminCheck.do",
			type: "POST",
			data: {"method":"measuring"},
            data: {"courseId":courseId}, 
			beforeSend: function(XMLHttpRequest){
			},
			success: function(data, textStatus){
				if(data=="success"){
				
				}else{ 
				
				}
			},

			complete: function(XMLHttpRequest, textStatus){
//			
			},
			error: function(){
				$("#ajaxResult").html("服务器异常，请联系网络管理员");
			}
		});
   }
	</script>
<div style="width:100%; margin:1px;text-align:center;margin-top:10px;margin-bottom:50px;">
 	<p style="border:0;font-size:14px;padding-bottom:0;text-align:center;">
 		<b>课程申报记录</b>
  		<select>
  			<option value="全部">全部</option>
  			<option value="2011年第一学期">2011年第一学期</option>
  			<option value="2011年第二学期">2011年第二学期</option>
  			<option value="2012年第一学期">2012年第一学期</option>
  		</select>
	</p>
	  <div id="tabs" style="height:500px;width:90%;margin-left:5%;">
		<ul>
			<li><a href="#tabs-1">待审批</a></li>
			<li><a href="#tabs-2">历史审批</a></li>
		</ul>
		<div id="tabs-1" style="width:100%;margin-left:0;padding-left:0;margin-top:20px;">
			<table>
		    		<tbody>
		              <tr height="32" bgcolor="#f0f0f0">
		              		<td align="center" width="10%">学期</td>
		                    <td align="center" width="8%">课程类型</td>
		                    <td align="center" width="7%">课程编号</td>
		                    <td align="center" width="14%">课程名称</td>
		                    <td align="center" width="20%">上课时间|地点</td>
		                    <td align="center" width="6%">人数限额<br>
		                      (最多/最少)</td>
		                    <td align="center" width="6%">审批</td>
		             </tr>
		             <%
		           		waitcheck_it = waitcheck_list.iterator();
		        		while(waitcheck_it.hasNext())
							{
								Hashtable<String, String> waitcheck_hash  = waitcheck_it.next();
					%>
			  		  <tr height="25" bgcolor="#ffffff">
			  		  	 <td align="center"><%=waitcheck_hash.get("year") %><%=waitcheck_hash.get("openterm") %></td>
		                 <td align="center"><%=waitcheck_hash.get("type") %></td>
		                 <td align="center"><%=waitcheck_hash.get("classno") %></td>
		                 <td align="center"><%=waitcheck_hash.get("name") %> </td>
		                 <td align="center"><%=waitcheck_hash.get("teach_time") %>|<%=waitcheck_hash.get("teach_location") %></td>
		                 <td align="center"><%=waitcheck_hash.get("students_high") %>/<%=waitcheck_hash.get("students_low") %></td>
		                 <td align="center"><a href="javascript:check(<%=waitcheck_hash.get("Id") %>)"   class="approve">[审批]</a></td>
		               </tr>
			  		<%} %>
		      </tbody>
		   </table>
		</div>
		<div id="tabs-2" style="width:100%;margin-left:0;padding-left:0;margin-top:20px;">
			<table>
		    		<tbody>
		              <tr height="32" bgcolor="#f0f0f0">
		              		<td align="center" width="10%">学期</td>
		                    <td align="center" width="8%">课程类型</td>
		                    <td align="center" width="7%">课程编号</td>
		                    <td align="center" width="14%">课程名称</td>
		                  <td align="center" width="6%">人数限额<br>
                      (最多/最少)</td>
                       		<td align="center" width="6%">审批结果</td>
		                    <td align="center" width="6%">查看</td>
		             </tr>
			  		   <%
		           		checked_it = checked_list.iterator();
		        		while(checked_it.hasNext())
							{
								Hashtable<String, String> checked_hash  = checked_it.next();
					%>
			  		  <tr height="25" bgcolor="#ffffff">
			  		  	 <td align="center"><%=checked_hash.get("year") %><%=checked_hash.get("openterm") %></td>
		         		 <td align="center"><%=checked_hash.get("type") %></td>
		                 <td align="center"><%=checked_hash.get("classno") %></td>
		                 <td align="center"><%=checked_hash.get("name") %> </td>
		                 <td align="center"><%=checked_hash.get("students_high") %>/<%=checked_hash.get("students_low") %></td>
		                 <td align="center">
		                 	<% if(checked_hash.get("checkstatus").equalsIgnoreCase("0")){%>
			             		审核中
				             	<% }else if(checked_hash.get("checkstatus").equalsIgnoreCase("1")){ %>
				             		审核通过
				             	<%}else{ %>
				             		审核不通过
				             	<%} 
				            %>
		                 </td>
		                 <td align="center"><a href="teacher/courseApplyApproveDetail.jspx"  target="_blank">[查看]</a></td>
		               </tr>
			          <%
			          }
			          %>
		      </tbody>
		   </table>
		</div>
		
	</div>
</div>

